js 加载 src=blob:

方法1: //计算表达式的值 
function evil(fn) { var Fn = Function; 
//一个变量指向Function，防止有些前端编译工具报错 return new Fn('return ' + fn)(); }

方法2: function eval1 (str) { var script = document.createElement('script'); script.type="text/javascript"; script.text=str; document.getElementsByTagName('head')[0].appendChild(script); document.head.removeChild(document.head.lastChild); }


方法3: blob


<link href="https://unpkg.com/video.js@7.6.0/dist/video-js.css" rel="stylesheet">
<script src="https://unpkg.com/video.js@7.6.0/dist/video.js"></script>
<script src="https://unpkg.com/videojs-contrib-hls@5.15.0/dist/videojs-contrib-hls.js"></script>

<video id="my_video_1" class="video-js vjs-default-skin fillWidth" controls width="640" height="268" data-setup='{}'>
<source src="http://localhost:666/abc.m3u8" type="application/x-mpegURL">
</video>

<script>
function loadJs(url,callback){
    var script=document.createElement('script');
        script.type="text/javascript";
        if(typeof(callback)!="undefined"){
            if(script.readyState){
                script.onreadystatechange=function(){
                    if(script.readyState == "loaded" || script.readyState == "complete"){
                        script.onreadystatechange=null;
                        callback();
                    }
            }
        }
        else
        {
            script.onload=function(){
            callback();
            }
        }
    }

    var debug = "window.aaa=9895464568;alert(3234234)";
    var blob = new Blob([debug],  {type : 'application/javascript'});
    var url = URL.createObjectURL(blob);
    script.src=url;
    console.log(url)
    document.body.appendChild(script);
    }
    loadJs("test.js",function(){
    console.log('done');
});
</script>
